-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: track package-lock.json #4238
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4238 +/- ##
==========================================
- Coverage 92.24% 92.18% -0.07%
==========================================
Files 331 319 -12
Lines 9481 8829 -652
Branches 1999 1875 -124
==========================================
- Hits 8746 8139 -607
+ Misses 735 690 -45 |
22c7915
to
e7c9c01
Compare
e7c9c01
to
1c9205f
Compare
I think I know what is failing the node 14 tests. If it's ok with you I'll just update your branch rather than creating a new PR since this is high priority and blocking all PRs |
Looks like the test is going to time out. It must be stuck somehow. running locally with the same changes results in a failure of the tree shaking test on my machine. I would appreciate if someone else could try to verify the behavior is the same on a windows or linux machine. |
tried on windows using the steps as in CI but it fails early during
Not sure but maybe the previous I think we should aim to get the build setup back into a state where a simple |
This should update the lockfiles so it shouldn't have that problem. I don't get that when I run it on mine and it doesn't happen on the CI either.
We only need to do the special steps for node 14. We were currently talking in the maintainer channel about the idea to simply stop testing 14 because of this problem. In the past when we've deprecated a node runtime without a major version we've gotten strong pushback, so we're trying to figure out other options first. So far we have:
|
retried with a really clean setup now. |
maybe worth to mention that I used the npm version coming with node. In my case it's npm 6.14.18 and node 14.21.3 |
I'm using the same and getting failures on a complete fresh build in macos following the exact steps in the workflow
The test failing is one that deals with mocking filesystems so it's entirely possible this is an OS level issue for me. The CI logs don't make it easy to see which test is causing the problem but it seems like it hangs forever. There are no tests that time out though so it appears to be hanging between tests or something? Maybe all tests are completed and the runtime just never finishes. |
I'm trying to remove the cache. Because we're using lockfiles, the node_modules is removed when bootstrap is run anyway and it is one variable we can remove for now. |
I pushed a change to break the cache to see if i'm just doing something wrong locally |
My cache break didn't break the build so I must be doing something locally causing the problem. edit: went through the steps again and it worked this time. I think the important step that I missed was not updating the global NPM installation |
I installed deps with Would you mind verifying the install command you use? |
Going through a clean install following the exact steps I was able to build and test fine. There is a test failure but I believe it is macos specific (it is the tree shaking test) so I would prefer to unblock the CI and resolve it in a separate PR. Here are my exact commands I used for reference which worked: # make sure directory is completely clean
rm -rf node_modules packages/*/node_modules experimental/packages/*/node_modules && git clean -ffdx
# install npm 10
npm install -g npm@"<10.0.0"
# install dependencies
npm ci
# compile packages
npm run compile
# test
npm run test |
Seems fast enough anyway without caches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. CI is always a headache.
OK to merge this whenever you're comfortable IMO. It's blocking other things so its high priority. |
"submodule": "git submodule sync --recursive && git submodule update --init --recursive", | ||
"version:update": "lerna run version:update", | ||
"version:update": "lerna run version", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm native version:
"version:update": "lerna run version", | |
"version:update": "npm run --ws --if-present version", |
(I assume lack of --if-present was the error mentioned in sig, worked with this in gh workspace of this PR)
optionally can add --
at end if you want to pass flags forward (npm run version:update --something
-> npm run version --something
in workspaces) but it's not necessary here
"version:update": "lerna run version", | |
"version:update": "npm run --ws --if-present version --", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it works in a more verbose manner. And worth mentioning that npm run
doesn't parallel the execution so it is much slower than lerna run
-- this is the main reason I didn't touch lerna run
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, tho at speed of version update script parallel's kinda whatever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah... the speed problem is about test, not version.
Aside: Is there a separate issue for the test hang with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tested with node 18 & 16 on macos.
- name: Install lerna | ||
run: npm install -g lerna | ||
run: npm install -g lerna@6.6.2 | ||
|
||
- name: Install semver | ||
run: npm install semver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This npm install semver
installs all dependencies anyway (npm issue: npm/cli#3023). This could consider just running npm ci
OR also installing semver globally (untested): npm install -g semver
. The latter, if it works, would avoid installing ~800MB of deps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also closes #3927 right? |
- use npm workspaces instead of lerna for monorepo install handling (requires at least npm@7, so node v14 users will have to update their npm) - updates to lerna@6, which brings parallel - add package-lock.json for more reliable dev and testing Refs: open-telemetry/opentelemetry-js#4238
* chore: track package-lock.json (#4238) * chore: track package-lock.json * Pin to old versions for node 14 * Use version range * Remove unused cached directories * Temporarily disable other tests * Temporarily enable only api test * Enable only some packages * Test only api packages * Test trace exporters * Fix line ordering * Test all packages except otlp exporters * Add trace http exporter * Add trace proto exporter * Test all but grpc exporters * chore: use npm workspaces and degrade lerna to v6 * chore: get rid of lerna bootstrap * chore: use npx * chore: allow install scripts to setup buf * chore: fix w3c-integration-test cache key * chore: fix cache key * chore: disable resource compat test * chore: fix node_modules assumptions * chore: fix hoisted karma issue * chore: fix markdown linter complaints * chore: lock @grpc/grpc-js to v1.8.21 * Break caches * chore: remove cache * chore: fixup inline commands --------- Co-authored-by: Daniel Dyla <[email protected]> * docs: fixed link to benchmark results (#4233) Co-authored-by: Chengzhong Wu <[email protected]> * chore(deps): update all patch versions (#4215) * fix: otlp json encoding (#4220) Co-authored-by: Marc Pichler <[email protected]> * fix: remove duplicate export star from version.ts (#4225) Co-authored-by: Marc Pichler <[email protected]> * docs: fix sdk-node config instructions (#4249) Co-authored-by: Marc Pichler <[email protected]> * feat(api): publish api esnext target (#4231) * chore: release API 1.7.0/Core 1.18.0/Experimental 0.45.0 (#4254) * fix(sdk-metrics): hand-roll MetricAdvice type as older API versions do not include it (#4260) * chore: prepare release 1.18.1/0.45.1 (#4261) * chore: no need for 'packages' in "lerna.json" (#4264) * Benchmark tests for trace OTLP transform and BatchSpanProcessor (#4218) Co-authored-by: Marc Pichler <[email protected]> * chore: type reference on zone.js (#4257) Co-authored-by: Marc Pichler <[email protected]> * docs: add docker-compose to run prometheus for the experimental example (#4268) Co-authored-by: Marc Pichler <[email protected]> * fix(sdk-logs): avoid map attribute set when count limit exceeded (#4195) Co-authored-by: Marc Pichler <[email protected]> * chore(deps): update dependency chromedriver to v119 [security] (#4280) * chore(deps): update actions/setup-node action to v4 (#4236) * fix(sdk-trace-base): processor onStart called with a span having empty attributes (#4277) Co-authored-by: artahmetaj <[email protected]> * Update fetch instrumentation to be runtime agnostic (#4063) Co-authored-by: Marc Pichler <[email protected]> --------- Co-authored-by: Chengzhong Wu <[email protected]> Co-authored-by: Martin Kuba <[email protected]> Co-authored-by: Mend Renovate <[email protected]> Co-authored-by: Siim Kallas <[email protected]> Co-authored-by: Marc Pichler <[email protected]> Co-authored-by: David Luna <[email protected]> Co-authored-by: Dinko Osrecki <[email protected]> Co-authored-by: Trent Mick <[email protected]> Co-authored-by: François <[email protected]> Co-authored-by: Hyun Oh <[email protected]> Co-authored-by: André Cruz <[email protected]> Co-authored-by: artahmetaj <[email protected]> Co-authored-by: drewcorlin1 <[email protected]>
Which problem is this PR solving?
Check-in package-lock.json to avoid breakage on regular CI runs. Dependencies should be updated regularly with renovate.
Fixes #785
Notable Changes:
lerna bootstrap
is replaced bynpm install
with npm workspaces.@lerna/legacy-package-management
is removed.lerna
is degraded to v6.6.2 to be consistent across all supported Node.js versions.@grpc/grpc-js
is locked to v1.8.21 inpackage-lock.json
.Type of change
Checklist: